//
//  PainterRectKDJ.m
//  ChartRefactor
//
//  Created by CaoJun on 15/3/16.
//  Copyright (c) 2015年 CaoJun. All rights reserved.
//

#import "PainterRectKDJ.h"

using namespace ytx;

@implementation PainterRectKDJ

- (void)drawColumn:(CGRect)cgrect withContext:(ChartCanvas *) ctx withViewModelIndexPosition:(ViewModelIndexPosition *) indexPosition
{
    Quotation * data = indexPosition->getData();

    Rectangle & rect = indexPosition->getRectangle();
    YTXConfig * config = YTXConfig::getInstance();
    ytx::Style style = config->style;

    std::vector<std::pair<double, std::string> > sideText =data->getLeftSideText(indexPosition->getStartDataIndex(), indexPosition->getEndDataIndex(), rect, style);

    CGFloat tempY;

    for (std::vector<std::pair<double, std::string> >::iterator it = sideText.begin(); it != sideText.end(); ++it) {
        tempY = rect.getPxY( (*it).first );
        [ctx drawLineWithX1:rect.getBeginX() withY1:tempY withX2:rect.getEndX() withY2:tempY];
    }

}


@end
